package database;

import java.io.File;

import org.tmatesoft.sqljet.core.SqlJetException;
import org.tmatesoft.sqljet.core.SqlJetTransactionMode;
import org.tmatesoft.sqljet.core.table.SqlJetDb;

public class DatabaseConnector
{

	
	public static void createDatabase(String DB_NAME) throws SqlJetException
	{
		File dbFile = new File(DB_NAME);
		dbFile.delete();

		SqlJetDb db = SqlJetDb.open(dbFile, true);
		db.getOptions().setAutovacuum(true);
		db.beginTransaction(SqlJetTransactionMode.WRITE);
		try
		{
			db.getOptions().setUserVersion(1);
		}
		finally
		{
			db.commit();
		}
	}

}
